package com.qf.ssm.vo;

import com.qf.ssm.entity.User;
import com.qf.ssm.utils.Constants;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author manchi520
 * @date 2022/7/5
 * @apiNote
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultVo {
    private String status;
    private String msg;
    private Object data;

    public ResultVo(String status, String msg) {
        this.status = status;
        this.msg = msg;
    }

    public static ResultVo ok(String msg) {

        return new ResultVo(Constants.SUCCESS, msg);

    }

    public static ResultVo ok(String msg, Object data) {

            return new ResultVo(Constants.SUCCESS, msg, data);

    }

    public static ResultVo fail(String msg, Object data) {

            return new ResultVo(Constants.FAIL, msg);

    }

    public static ResultVo fail(String msg) {

        return new ResultVo(Constants.FAIL, msg);
    }
}
